import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const modules = {}

const files = require.context('store/module', true, /index\.js$/)

const paths = files.keys()

for (const path of paths) {
  const module = files(path).default
  modules[module.name] = module
}

export default new Vuex.Store({
  state: {},
  mutations: {},
  actions: {},
  modules
})
